/*
 * 作者:熊猫
 * 日期:2017 - 3 - 14 11 - 24 - 34
 *
 */

package net.lainiao.morethread.Chapter6.demo3;

import java.util.PriorityQueue;
import java.util.concurrent.PriorityBlockingQueue;

/**
 * Created by Administrator on 2017/3/14.
 */
public class Task implements Runnable {
    private int threadId;
    private PriorityBlockingQueue<Event> events;

    public Task(int threadId, PriorityBlockingQueue<Event> events) {
        this.threadId = threadId;
        this.events = events;
    }

    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            Event event=new Event(threadId,i);
            events.add(event);
        }
    }
}
